from pydantic import BaseModel, Field
from typing import Optional

from decimal import Decimal


class CaseQcBase(BaseModel):
    case_id: int = Field(..., description="案情id")
    project_id: Optional[int] = Field(None, description="项目id")
    qctype: str = Field(..., description="案情质量类型")
    qcseq: str = Field(..., description="案情质量序号")
    name: str = Field(..., description="案情质量名称")
    sort: Optional[int] = Field(None, description="排序")
    options: Optional[str] = Field(None, description="选项 默认N 选择Y/N")
    score: Optional[Decimal] = Field(None, description="得分 默认0")
    created_by: Optional[str] = Field(None, description="创建人")
    created_dept: Optional[str] = Field(None, description="创建部门")
    remark: Optional[str] = Field(None, description="备注说明")


class CaseQcCreate(CaseQcBase):
    pass


class CaseQcUpdate(BaseModel):
    case_id: Optional[int] = Field(None, description="案情id")
    project_id: Optional[int] = Field(None, description="项目id")
    qctype: Optional[str] = Field(None, description="案情质量类型")
    qcseq: Optional[str] = Field(None, description="案情质量序号")
    name: Optional[str] = Field(None, description="案情质量名称")
    sort: Optional[int] = Field(None, description="排序")
    options: Optional[str] = Field(None, description="选项 默认N 选择Y/N")
    score: Optional[Decimal] = Field(None, description="得分 默认0")
    created_by: Optional[str] = Field(None, description="创建人")
    created_dept: Optional[str] = Field(None, description="创建部门")
    remark: Optional[str] = Field(None, description="备注说明")
